<template>
  <el-dialog
    :title="!dataForm.id ? '用户详情' : ''"
    :close-on-click-modal="false"
    :visible.sync="visible"
    width="1000px">
    <el-form :model="dataForm"  ref="dataForm" label-width="80px">
    <el-row>
      <el-col :span="12">
    <el-form-item label="联系名称:" prop="name">
      {{dataForm.name}}
    </el-form-item>
      </el-col>
       <el-col :span="12">
    <el-form-item label="联系邮箱:" prop="email">
      {{dataForm.email}}
    </el-form-item>
    </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
    <el-form-item label="联系电话:" prop="phone">
      {{dataForm.phone}}
    </el-form-item>
     </el-col>
       <el-col :span="12">
    <el-form-item label="真实姓名:" prop="realName">
      {{dataForm.realName}}
    </el-form-item>
     </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
    <el-form-item label="身份证号:" prop="idNo">
      {{dataForm.idNo}}
    </el-form-item>
    </el-col>
       <el-col :span="12">
    <el-form-item label="出生日期:" prop="birthday">
      {{dataForm.birthday}}
    </el-form-item>
    </el-col>
    </el-row>
     <el-row>
      <el-col :span="12">
    <el-form-item label="性别:" prop="sex">
       {{dataForm.sex == 0 ? "女" : "男"}}
    </el-form-item>
     </el-col>
       <el-col :span="12">
          <el-form-item label="当前状态:">
             {{dataForm.status == 1 ? "启用" : "禁用"}}
          </el-form-item>
     </el-col>
    </el-row>
      <el-row>
         <el-col :span="12">
    <el-form-item label="国家:" prop="livingCountry">
      {{dataForm.livingCountry}}
    </el-form-item>
      </el-col>
      <el-col :span="12">
    <el-form-item label="家庭地址:" prop="livingCountry">
      {{dataForm.livingState}}{{dataForm.livingCity}}{{dataForm.livingRegion}}
    </el-form-item>
      </el-col>
    </el-row>
     <!-- <el-form-item label="头像:" prop="headImgs">
          </el-form-item> -->

    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
    </span>
  </el-dialog>
</template>

<script>
  export default {
    name:'detils',
    data () {
      return {
        visible: false,
        dataForm: {
          id: 0,
          name: '',
          email: '',
          phone: '',
          status: '',
          gruop:'',
          realName: '',
          idNo: '',
          birthday: '',
          sex: '',
          headImgs: '',
          livingCountry: '',
          livingState: '',
          livingCity: '',
          livingRegion: '',
          addUser: '',
          addTime: '',
          editUser: '',
          editTime: ''
        },
        options:[],

      }
    },
    created(){

    },
    methods: {
      init (id) {
        this.visible = true
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
          if (id) {
            this.$http({
              url: this.$http.adornUrl(`/smsgcontact/info/${id}`),
              method: 'get',
              params: this.$http.adornParams()
            }).then(({data}) => {
              if (data && data.code === 0) {
                this.dataForm.name = data.smsgContact.name
                this.dataForm.email = data.smsgContact.email
                this.dataForm.phone = data.smsgContact.phone
                this.dataForm.status = data.smsgContact.status
                this.dataForm.gruop = data.smsgContact.group
                this.dataForm.realName = data.smsgContact.realName
                this.dataForm.idNo = data.smsgContact.idNo
                this.dataForm.birthday = data.smsgContact.birthday
                this.dataForm.sex = data.smsgContact.sex
                this.dataForm.headImgs = data.smsgContact.headImgs
                this.dataForm.livingCountry = data.smsgContact.livingCountry
                this.dataForm.livingState = data.smsgContact.livingState
                this.dataForm.livingCity = data.smsgContact.livingCity
                this.dataForm.livingRegion = data.smsgContact.livingRegion
                this.dataForm.addUser = data.smsgContact.addUser
                this.dataForm.addTime = data.smsgContact.addTime
                this.dataForm.editUser = data.smsgContact.editUser
                this.dataForm.editTime = data.smsgContact.editTime
              }
            })
          }
        })
      },
    }
  }
</script>
